Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#781 Add Syslog logging for watcher #1151

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JudgeGregg
Copy link

See #781

How to use:

stdout_stream.class = SyslogStream
and
stdout_stream.syslog_url = syslog:///dev/log
or
stdout_stream.syslog_url = syslog://127.0.0.1:514?user

"ident" attribute can also be passed as an argument:
stdout_stream.ident = my_ident

If using a local UNIX socket (/dev/log):

  • it's a simple wrapper of the standard lib syslog call
  • facility is set to 'user'
  • priority is set to 'info'

If using remote address:

  • protocol is UDP only
  • facility depends on the syslog url, defaults to 'user'
  • priority is set to 'info'

Tests use a simple UDP socket for remote syslog.
I don't know how to test a local syslog.

Thank you for your work on circus :)

@k4nar
Copy link
Contributor

k4nar commented Dec 14, 2020

Thank you for your contribution!

I wonder if this isn't already supported by the logoutput option documented here: https://circus.readthedocs.io/en/latest/for-ops/configuration/ .

@JudgeGregg
Copy link
Author

I may be wrong, but I believe this setting is for the circusd master process, and I could'nt find a way to apply the same configuration for watchers?

With the following config, my watcher's stdout goes to the terminal:

[circus]
logoutput = syslog:///dev/log?user

[watcher:foo]
cmd = python
args = -u foo.py
numprocesses = 1

But it's also perfectly possible that I just overlooked a setting in the configuration file :)

@k4nar
Copy link
Contributor

k4nar commented Jan 25, 2021

I've never tried to use this. But the doc clearly indicates that it should be the way to log to Syslog, so if it doesn't work I think we should fix it before introducing a new option for it 😄 .

logoutput
The logoutput file where we want to log (default: - to log on stdout). You can log to a remote syslog by using the following syntax: syslog://host:port?facility where host is your syslog server, port is optional and facility is the syslog facility to use. If you wish to log to a local syslog you can use syslog:///path/to/syslog/socket?facility instead.

@MFlossmann
Copy link
Contributor

MFlossmann commented Mar 15, 2021

I've never tried to use this. But the doc clearly indicates that it should be the way to log to Syslog, so if it doesn't work I think we should fix it before introducing a new option for it smile .

logoutput
The logoutput file where we want to log (default: - to log on stdout). You can log to a remote syslog by using the following syntax: syslog://host:port?facility where host is your syslog server, port is optional and facility is the syslog facility to use. If you wish to log to a local syslog you can use syslog:///path/to/syslog/socket?facility instead.

This only applies to the arbiter, i.e. the circusd, but not the watchers. The watchers don't have an option to stream to syslog (edit: As JudgeGregg pointed out).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants